<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>添加分类</title>
<link rel="stylesheet" type="text/css"
	href="__PUBLIC__/skin/admin/css/base.css">
<script type="text/javascript" language="javascript"
	src="__TMPL__skin/js/jquery.js"></script>
<script language="javascript">
function viewArc(aid){
	if(aid==0) aid = getOneItem();
	window.open("archives.asp?aid="+aid+"&action=viewArchives");
}
function editArc(aid){
	if(aid==0) aid = getOneItem();
	location="archives.asp?aid="+aid+"&action=editArchives";
}
function updateArc(aid){
	var qstr=getCheckboxItem();
	if(aid==0) aid = getOneItem();
	location="archives.asp?aid="+aid+"&action=makeArchives&qstr="+qstr+"";
}
function checkArc(aid){
	var qstr=getCheckboxItem();
	if(aid==0) aid = getOneItem();
	location="archives.asp?aid="+aid+"&action=checkArchives&qstr="+qstr+"";
}
function moveArc(aid){
	var qstr=getCheckboxItem();
	if(aid==0) aid = getOneItem();
	location="archives.asp?aid="+aid+"&action=moveArchives&qstr="+qstr+"";
}
function adArc(aid){
	var qstr=getCheckboxItem();
	if(aid==0) aid = getOneItem();
	location="archives.asp?aid="+aid+"&action=commendArchives&qstr="+qstr+"";
}
function delArc(aid){
	var qstr=getCheckboxItem();
	if(aid==0) aid = getOneItem();
	location="archives.asp?aid="+aid+"&action=delArchives&qstr="+qstr+"";
}

//获得选中文件的文件名
function getCheckboxItem()
{
	var allSel="";
	if(document.form2.id.value) return document.form2.id.value;
	for(i=0;i<document.form2.id.length;i++)
	{
		if(document.form2.id[i].checked)
		{
			if(allSel=="")
				allSel=document.form2.id[i].value;
			else
				allSel=allSel+"`"+document.form2.id[i].value;
		}
	}
	return allSel;
}

//获得选中其中一个的id
function getOneItem()
{
	var allSel="";
	if(document.form2.id.value) return document.form2.id.value;
	for(i=0;i<document.form2.id.length;i++)
	{
		if(document.form2.id[i].checked)
		{
				allSel = document.form2.id[i].value;
				break;
		}
	}
	return allSel;
}
function selAll()
{
	for(i=0;i<document.form2.id.length;i++)
	{
		if(!document.form2.id[i].checked)
		{
			document.form2.id[i].checked=true;
		}
	}
}
function noSelAll()
{
	for(i=0;i<document.form2.id.length;i++)
	{
		if(document.form2.id[i].checked)
		{
			document.form2.id[i].checked=false;
		}
	}
}

$(document).ready(function () {
	/*城市级联*/
					$("#province").change(function(){
						  var id = $(this).val();
						   if(id == 0){
							     $("#city").html(""); 
							   $("#city").append(' <option value="0" >全部城市</option>');
							  return false;   
							}
						   var url = "{:U('getcity',array('id'=>'"+id+"'))}";
						    //alert(url);
						   $.get(url,function(data){
							 
							     $("#city").html(""); 
								 for(var i=0;i<data.length;i++){
									 
									
							       $("#city").append(' <option value="'+data[i].id+'" >'+data[i].city+'</option>');
								 }
							   },"json");
						
						});
});
					

</script>
</head>
<body leftmargin="8" topmargin="8"
	background='__PUBLIC__/skin/images/allbg.gif'>

<!--  快速转换位置按钮  -->
<table width="98%" border="0" cellpadding="0" cellspacing="1"
	bgcolor="#D1DDAA" align="center">
	<tr>
		<td height="26" background="__PUBLIC__/skin/images/newlinebg3.gif">
		<table width="98%" border="0" cellspacing="0" cellpadding="0">
			<tr>
				<td align="center"><strong>添加城市广告</strong></td>
			</tr>
		</table>
		</td>
	</tr>
</table>

<!--  内容列表   -->
<form name="form2" action="" method="post" enctype="multipart/form-data">
<table width="98%" border="0" align="center" cellspacing="1"
	bgcolor="#D1DDAA"  enctype="multipart/form-data">


	<tr>
		<td width="100" height="25" bgcolor="#FFFFFF">&nbsp;选择城市：</td>
		<td bgcolor="#FFFFFF"><select id="province" name="province"
			style="width: 100px">
              <option value="0" selected="selected">全部城市</option>
			<volist name="province" id="v">
          
			<if condition="$v['id'] eq $pid ">
			<option value="{$v['id']}" selected="selected">{$v['province']}</option>
			<else />
			<option value="{$v['id']}">{$v['province']}</option>
			</if>
			</volist>

		</select> 
        
        <select id="city" name="city" style="width: 100px">
          <option value="0" selected="selected">全部城市</option>
			
		</select></td>
	</tr>
	<tr>

		<td height="25" bgcolor="#FFFFFF">广告图片:</td>

		<td bgcolor="#FFFFFF"><input type="file" name="photo"
			id="photo" /></td>


	</tr>
	
	      <tr>
    <td height="25" bgcolor="#FFFFFF">&nbsp;链接地址：</td>
    <td bgcolor="#FFFFFF">http://<input name="url" type="text" id="path"  style="height:25px; width:200px;"> </td>
  </tr>
	<tr>
		<td height="25" bgcolor="#FFFFFF">&nbsp;备注内容：</td>
		<td bgcolor="#FFFFFF"><input name="remark" type="text" id="path"
			style="height: 25px; width: 200px;"></td>
	</tr>
    <tr>
    <td height="25" bgcolor="#FFFFFF">&nbsp;到期时间：</td>
    <td bgcolor="#FFFFFF"><input name="endtime" type="text" id="path"  style="height:25px; width:200px;">
    （格式 2018-1-15） </td>
  </tr>
	<tr>
		<td height="25" bgcolor="#FFFFFF">&nbsp;</td>
		<td bgcolor="#FFFFFF"><input type="submit" name="submit"
			value="提交"></td>
	</tr>

</table>
<script type="text/javascript">
$(document).ready(function () {
	/*城市级联*/
					$("#City001").change(function(){
						  var cityid = $(this).val();
						   var url = "{:U('getcity',array('id'=>'"+cityid+"'))}";
						   $.get(url,function(data){
							 
							     $("#City002").html(""); 
								 for(var i=0;i<data.length;i++){						
							       $("#City002").append(' <option value="'+data[i].id+'" >'+data[i].city+'</option>');
								 }
							   },"json");
						
						});
});
					

</script></form>
</body>
</html>